package basic;

/**
 * 自定义方法演示
 */
public class FunctionTest01 {
    public static void main(String[] args) {
        /*boolean f = login("zhangsan","1234");
        System.out.println(f);*/
        userList("zhangsan","1234");



    }
    /**登录的方法*/
    public static boolean login(String username,String pwd){
        //判断用户名是不是zhangsan,密码是不是1234
        if(username.equals("zhangsan") && pwd.equals("1234")){
            return true;
        }else{
            return false;
        }

    }

    /**登录成功后的列表方法*/
    public static void userList(String username,String pwd){
        boolean flag = login(username,pwd);
        if(flag){
            System.out.println("登录成功，欢迎来到xxx");
        }else{
            System.out.println("请先登录");
        }

    }




}
